﻿@using System.Web.UI.WebControls
@using KMF.Common
@using KMF.WebUI.Areas.KMFadmin.Models
@using KMF.WebUI.Areas.KMFadmin.CustomHelpers
@model NewsCategoryDto
@{
    ViewBag.Title = "AddNewsCategory";
    Layout = "~/Areas/KMFadmin/Views/Shared/_layout.cshtml";
}

<nav>
    <div id="jCrumbs" class="breadCrumb module">
        <ul>
            <li><a href="@Url.Action("Index", "AdminHome")"><i class="bootstrap icon-home"></i></a></li>
            <li><a href="javascript:void(0)">Sản phẩm</a> </li>
            <li><a href="@Url.Action("Index", "AdminNewsCategory")">Nhóm tin</a> </li>
            <li><a href="@Url.Action("AddNewsCategory", "AdminNewsCategory")">Thêm nhóm tin</a> </li>
        </ul>
    </div>
</nav>
<div class="toolBox">
    @Html.ToolBox(new List<object> { new Save() { ClassCss = "Save", ActionName = "Javascript:void(0)" }, new Delete() { ClassCss = "Del", ActionName = "DelCategory" }, new Back { ClassCss = "Back", ActionName = @Url.Action("Index", "AdminNewsCategory") } })
</div>
<div class="box-Info">
    <div class="Info-header">
        <span>Thêm mới danh mục </span>
    </div>
    <div class="Info-body">
        @using (Html.BeginForm("AddNewsCategory", "AdminNewsCategory", FormMethod.Post, new { @class = "formAddCate", enctype="multipart/form-data" }))
        {
            <table cellpadding="0" cellspacing="0" width="100%" border="0" class="table-info">
                <tr>
                    <td class="tInfoLeft">Tên danh mục
                    </td>
                    <td class="tInfoRight">
                        @Html.TextBoxFor(m => m.CateName)
                        @Html.ValidationMessageFor(m => m.CateName)
                    </td>
                </tr>
                <tr>
                    <td class="tInfoLeft">Danh mục cha
                    </td>
                    <td class="tInfoRight">
                        @Html.DropDownListFor(m => m.ParentId, new SelectList(((List<NewsCategoryDto>)(ViewBag.ParentList)) ?? new List<NewsCategoryDto>(), "Id", "CateName"))
                    </td>
                </tr>
                <tr>
                    <td class="tInfoLeft">Mô tả ngắn
                    </td>
                    <td class="tInfoRight">
                        @Html.TextAreaFor(m => m.Summary, new { @class = "texareaCss" })
                    </td>
                </tr>
                <tr>
                    <td class="tInfoLeft">Meta title
                    </td>
                    <td class="tInfoRight">
                        @Html.TextBoxFor(m => m.MetaTitle, new { @onkeyup = "countTextAreaChar(this, 70,'countNewsMetaTitle')" })<br />
                        <input readonly="readonly" class="cssInputHidden" type="text" name="countNewsMetaTitle" size="3" maxlength="3" style="width: 53px; height: 23px; margin: 0px; padding: 0px 0px 0px 10px;" value="0">
                        ký tự. Hầu hết các công cụ tìm kiếm sử dụng tối đa <span style="color: red;">70</span> ký tự cho tiêu đề
                    </td>
                </tr>
                <tr>
                    <td class="tInfoLeft">Meta description
                    </td>
                    <td class="tInfoRight">
                        @Html.TextAreaFor(m => m.MetaDescription, new { @class = "texareaCss", @onkeyup = "countTextAreaChar(this, 160,'countNewsMetaDesc')" })
                        <br />
                        <input readonly="readonly" class="cssInputHidden" type="text" name="countNewsMetaDesc" size="3" maxlength="3" style="width: 53px; height: 23px; margin: 0px; padding: 0px 0px 0px 10px;" value="0">
                        ký tự. Hầu hết các công cụ tìm kiếm sử dụng tối đa <span style="color: red;">160</span> ký tự cho các mô tả
                    </td>
                </tr>
                <tr>
                    <td class="tInfoLeft">Meta keyword
                    </td>
                    <td class="tInfoRight">
                        @Html.TextAreaFor(m => m.MetaKeyword, new { @class = "texareaCss" })
                    </td>
                </tr>
                <tr>
                    <td class="tInfoLeft">Thứ tự
                    </td>
                    <td class="tInfoRight">
                        @Html.TextBoxFor(m => m.Ordering, new { @class = "txtOrdering", @Value="0" })
                    </td>
                </tr>
                <tr>
                    <td class="tInfoLeft">Kích hoạt
                    </td>
                    <td class="tInfoRight">
                        @Html.CheckBoxFor(m => m.Active, new { @checked = "checked"})
                    </td>
                </tr>
                <tr>
                    <td class="tInfoLeft">Loại tin
                    </td>
                    <td class="tInfoRight">
                        @{
            var listItems = new List<ListItem> { new ListItem { Text = "news", Value = "news" }, new ListItem { Text = "about", Value = "about" } };
                        }
                        @Html.DropDownListFor(model => model.Type, new SelectList(listItems))
                    </td>
                </tr>
            </table>
        }
    </div>
</div>

@section scripts
{
    <script>
        SubmitFormUseToolBox($('ul li.Save a'), $('form'));
    </script>
}
